<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    643. Maximum Average Subarray I
   </h1>
   <p>
    Given an array consisting of
    <code>
     n
    </code>
    integers, find the contiguous subarray of given length
    <code>
     k
    </code>
    that has the maximum average value. And you need to output the maximum average value.
   </p>
   <p>
    <b>
     Example 1:
    </b>
   </p>
   <pre>
<b>Input:</b> [1,12,-5,-6,50,3], k = 4
<b>Output:</b> 12.75
<b>Explanation:</b> Maximum average is (12-5-6+50)/4 = 51/4 = 12.75
</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <b>
     Note:
    </b>
   </p>
   <ol>
    <li>
     1 &lt;=
     <code>
      k
     </code>
     &lt;=
     <code>
      n
     </code>
     &lt;= 30,000.
    </li>
    <li>
     Elements of the given array will be in the range [-10,000, 10,000].
    </li>
   </ol>
   <p>
    &nbsp;
   </p>
  </div>
  <div>
   <h1 class="question_title">
    643. 子数组最大平均数 I
   </h1>
   <p>
    给定
    <code>
     n
    </code>
    个整数，找出平均数最大且长度为
    <code>
     k
    </code>
    的连续子数组，并输出该最大平均数。
   </p>
   <p>
    <strong>
     示例 1:
    </strong>
   </p>
   <pre><strong>输入:</strong> [1,12,-5,-6,50,3], k = 4
<strong>输出:</strong> 12.75
<strong>解释:</strong> 最大平均数 (12-5-6+50)/4 = 51/4 = 12.75
</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     注意:
    </strong>
   </p>
   <ol>
    <li>
     1 &lt;=
     <code>
      k
     </code>
     &lt;=
     <code>
      n
     </code>
     &lt;= 30,000。
    </li>
    <li>
     所给数据范围 [-10,000，10,000]。
    </li>
   </ol>
  </div>
 </body>
</html>